<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.div1{
		display: none;
		position: fixed;
		left:calc(50% - 250px);
		top:calc(50% - 250px);
		width:500px;
		height:500px;
		text-align: center;
	}
</style>
<script type="text/javascript">
	function a(){
		
		document.getElementById("div2").display="block";
		document.write(document.getElementById("hhh").innerHTML);//表示重新写这个页面
		
		
	}
</script>
</head>
<body id="hhh">
	<div id="contain">
	<form action="petupt.do" method="post" enctype="multipart/form-data" >
		性别： <input type="radio" name="sex" value="公" <c:if test="${pet.sex==null }">checked</c:if> <c:if test='${pet.sex=="公" }'>checked</c:if> />公
		<input type="radio" name="sex" value="母"  <c:if test='${pet.sex=="母" }'>checked</c:if>/>母
		<br>
		标题：<input type="text" name="title" value="<c:if test='${pet.title!=null }'>${pet.title }</c:if>"/>
		<br>
		类别：<input type="radio" name="classes" value="猫" <c:if test="${pet.classes==null }">checked</c:if> <c:if test='${pet.classes=="猫" }'>checked</c:if>>猫
		<input type="radio" name="classes"  value="狗" <c:if test='${pet.classes=="狗" }'>checked</c:if>>狗
		<input type="radio" name="classes" value="兔" <c:if test='${pet.classes=="兔" }'>checked</c:if>>兔
		<input type="radio" name="classes" value="龟" <c:if test='${pet.classes=="龟" }'>checked</c:if>>龟
		<input type="radio" name="classes" value="其他" <c:if test='${pet.classes=="其他" }'>checked</c:if>>其他
		<br>
		售出状态：<input type="radio" name="sale" value="已售出"  <c:if test='${pet.sale=="已售出" }'>checked</c:if>>已售出
		<input type="radio" name="sale" value="未售出" <c:if test="${pet.sale==null }">checked</c:if> <c:if test='${pet.sale=="未售出" }'>checked</c:if> >未售出  
		<br>
		发货状态：<input type="radio" name="status" value="已发货" checked="checked" <c:if test='${pet.status=="已发货" }'>checked</c:if>>已发货
		<input type="radio" name="status" value="已发货" <c:if test="${pet.status==null }">checked</c:if> <c:if test='${pet.status=="未发货" }'>checked</c:if>>未发货  
		<br>
		年龄：<input type="number" name="age" value="<c:if test='${pet.age!=null }'>${pet.age }</c:if>">
		<br>
		尺寸：<input type="number" name="size" value="<c:if test='${pet.size!=null }'>${pet.size }</c:if>">
		<br>
		价格：<input type="number" name="price" value="<c:if test='${pet.price!=null }'>${pet.price }</c:if>">  
		<br>
		颜色：<input type="text" name="color" value="<c:if test='${pet.color!=null }'>${pet.color }</c:if>"> 
		<br>
		<div class="div1" id="div2">
			上传宠物图片1：<input type="file" name="pic1" />
			<br>
			上传宠物图片2：<input type="file" name="pic2" />
			<br>
			上传宠物图片3：<input type="file" name="pic3" />
			<br>
			上传宠物图片4：<input type="file" name="pic4" />
			<br>
			上传宠物图片5：<input type="file" name="pic5" />
			<br>
			
		</div>
		
		<input type="submit" value="上传宠物">
	</form>
	<button onclick="a()">编辑图片</button>
	</div>
</body>
</html>